/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

/**
 *
 * @author shone
 */
public class Startup {

    public static void main(String[] args) {
        String adresa = "www.google.com";
        int port = 80;
        int interval = 5 * 60;

        try {
            if (args != null && args.length == 3) {
                adresa = args[0];
                port = Integer.parseInt(args[1]);
                interval = Integer.parseInt(args[2]);

                if(port < 1 || port > 65535)
                    throw new Exception();
            } else {
                System.out.println(
                        "Postavljam default vresnosti:"
                        + "\nadresa = www.google.com"
                        + "\nport = 80"
                        + "\ninterval = 300");
            }

            MainGui mg = new MainGui(adresa, port, interval);
            mg.setVisible(true);
        } catch (Exception e) {
            System.out.println(
                    "Ulazni argumenti:"
                    + "\nadresa - string"
                    + "\nport - celobrojna vrednost izmedju 1 i 65535"
                    + "\ninterval - celobrojna vrednost: broj sekundi izmedju "
                    + "dve provere dostupnosti unete adrese");
        }
    }
}
